require.config({
	baseUrl: '../',
	packages: [{
		name: 'butterfly',
		location: './com.no5.butterfly/js',
		main: 'butterfly'
	}],
	paths: {
		// require.js plugins
		view: 'com.no5.butterfly/js/requirejs-butterfly',
		// lib
		zepto: 'com.no5.butterfly/bower_components/zepto/zepto',
		jquery: 'com.no5.butterfly/bower_components/jquery/jquery-1.9.1.min',
		// jquery: 'lib/bower_components/jquery/jquery-1.9.1.min',
		underscore: 'com.no5.butterfly/bower_components/underscore/underscore',
		backbone: 'com.no5.butterfly/bower_components/backbone/backbone',
		text: 'com.no5.butterfly/bower_components/requirejs-text/text',
		spin: 'com.no5.butterfly/bower_components/spin.js/spin.min',
		butterfly: 'com.no5.butterfly/js/butterfly',
		commonObj: 'com.no5.butterfly/js/common',
		i18n: 'com.no5.butterfly/bower_components/requirejs-i18n/js/i18n',
		components: 'com.no5.butterfly/components/components',
		//以下的是组件
		iScroll: 'com.no5.butterfly/bower_components/iscroll/js/iscroll-lite',
		list: 'com.no5.butterfly/components/list',
		
		//listview组件使用到的iscroll
		iscroll:'com.no5.butterfly/bower_components/iscroll/js/iscroll-probe',
		listview: 'com.no5.butterfly/components/listview/Listview',
		bsl: 'bsl' ,
		//gum
		// gum: 'lib/components/gum',
		// should be ok, but cannot switch language
        // gmunls: 'lib/components/nls/gmu',

	},
	waitSeconds: 7,
	shim: {
		zepto: {
			exports: '$'
		},
		underscore: {
			exports: '_'
		},
		iScroll: {
			exports: 'iScroll'
		},
		//iscroll-lite中不存在listview中使用到的部分方法，所以使用iscroll-probe
		iscroll:{
			exports : 'IScroll'
		},
		backbone: {
			deps: ['underscore'],
			exports: 'Backbone'
		},
		// gmu: {
		// 	exports: 'gmu',
		// 	deps: ['jquery', 'i18n',
		// 	'gmunls'
		// 		//                'i18n!butterfly/soc/components/nls/gmu'
		// 	]
		// },
	}
});

require(['butterfly','components'],
	function(butterfly, Components) {

		//ios7 issue fix
		// if (navigator.userAgent.match(/iPad;.*CPU.*OS 7_\d/i)) {
		// 		$('html').addClass('ipad ios7');
		// }
		//iOS scroll to top
		setTimeout(function() {
			window.scrollTo(0, 1);
		}, 0);


		butterfly = _.extend(butterfly, Components);


		console.info("butterfly...");
		console.info(Butterfly);
		console.info('Components...');
		console.info(Components);



		//enable fastclick
		// FastClick.attach(document.body);

		//this will stop the page from scrolling without IScroll
		// document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
	});